package cs

/**
 * Created by Administrator on 2019/09/11.
 */
open class Rectangle {
    open fun draw(){println("drawing fun in rectangle")}

    val borderColor : String get() = "red"
}

class filedRectangle : Rectangle(){
    override fun draw() {
        super.draw()
        println("filled rec drawing")
    }

    var fd : Int = 0
        set(value) {
            if (value > 0) field = value
        }

    val fillColor : String get() = super.borderColor
}

const val PI : Double = Math.PI

fun main(args:Array<String>)
{
    var fd = filedRectangle()
    fd.fd = 1;
    println(fd.fd)
}

interface Named{
    val name:String
}

interface Person:Named{
    val firstName:String
    val lasName : String
    override val name: String
        get() = "firstName = ${firstName}, lastName = ${lasName}"
}

class XiaoMing(override val firstName: String, override val lasName: String) :Person{

}